package cms.jason.dao;

import cms.jason.entity.TopImage;
import cms.jason.entity.TopImage_;
import com.cn.lotary.base.dao.BaseDao;
import com.cn.lotary.base.dao.BaseDaoParam;
import java.util.List;
import javax.ejb.Stateless;
import javax.faces.application.FacesMessage;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Jason
 */
@Stateless
public class TopImageDao extends BaseDao<TopImage> {

    @PersistenceContext
    private EntityManager em;

    @Override
    protected BaseDaoParam<TopImage> getBaseDaoParam() {
        return new BaseDaoParam<TopImage>(em, TopImage.class);
    }

    public List<TopImage> getShowImages() {
        return findByField(TopImage_.display.getName(), 0);
    }

    @Override
    public FacesMessage remove(TopImage t) {
        //TODO:delete file
        return super.remove(t);
    }
    
}
